/**********************************************************************
 *<
	FILE: HujubExporter.h

	DESCRIPTION:	Includes for Plugins

	CREATED BY:

	HISTORY:

 *>	Copyright (c) 2000, All Rights Reserved.
 **********************************************************************/

#ifndef __HUJUBEXPORTER__H
#define __HUJUBEXPORTER__H

#include "Max.h"
#include "resource.h"
#include "istdplug.h"
#include "iparamb2.h"
#include "iparamm2.h"

#include "utilapi.h"

#define HUJUBEXPORTER_CLASS_ID	Class_ID(0x444274d, 0x28b25fb8)

//		Start User		//

#include ".\\Util\\HjUtil.h"
#include ".\\Util\\HJ_uFileMng.h"
#include "BipedMng.h"
#include "SkinExp.h"
#include "MatrixExp.h"


extern TCHAR		*GetString(int id);
extern HINSTANCE	hInstance;

/*---------------------------------------
				Struct
---------------------------------------*/

enum	OutputDir
{
    OUTDIR_HEAD = 0,
	OUTDIR_UPPER,
	OUTDIR_LOWER,
	OUTDIR_SHOES,
	OUTDIR_FACE,
};

struct HJ_ExpOption
{
	// Check Export
	bool	bChkMtl;
	bool	bChkGeom;
	bool	bChkAnim;
	bool	bChkBip;

	int		iOutputDir;

	// Geometry Type
	bool	bOnlySelect;	// FALSE == ALL

	// Reference Name
	TCHAR	szRefName[MAX_STR];

    // Optimize Option
	bool	bVtxOp;
	bool	bTVtxOp;

	void Init()
	{
        bChkMtl		= TRUE;
		bChkGeom	= TRUE;
		bChkAnim	= false;
		bChkBip		= TRUE;
		bOnlySelect	= FALSE;
		bVtxOp		= TRUE;
		bTVtxOp		= TRUE;
		hjZERO( szRefName , MAX_STR );

		iOutputDir	= OUTDIR_HEAD;
	}
};

//		End User		//

class HujubExporter : public UtilityObj 
{	
//		Start User		//
public:
	bool			m_bExportOK;
	TCHAR			m_szTexPath[MAX_PATH];
	TCHAR			m_szCurLevelPath[MAX_PATH];

	// Export Option
	HJ_ExpOption	m_ExpOption;

	// Window Handle
	HWND			m_hExpOptionDlg; // Option Dlg Handle
	
public:

	VOID	SetStatus( const TCHAR* pFormat );
	BOOL	SetFolder();
	VOID	InitVariable();
	//HWND	hPanel_2;
	//HWND	hPanel_3;
	void	ResetTM( Interface* ip , INode* pNode );

//		End User		//

public:

	HWND			hPanel;
	IUtil			*iu;
	Interface		*ip;
	
	void BeginEditParams(Interface *ip,IUtil *iu);
	void EndEditParams(Interface *ip,IUtil *iu);

	BOOL Init(HWND hWnd);
	void Destroy(HWND hWnd);
	

	void DeleteThis() { }
	//Constructor/Destructor

	HujubExporter();
	~HujubExporter();		

};

static HujubExporter theHujubExporter;

class HujubExporterClassDesc:public ClassDesc2 {
	public:
	int 			IsPublic() { return TRUE; }
	void *			Create(BOOL loading = FALSE) { return &theHujubExporter; }
	const TCHAR *	ClassName() { return GetString(IDS_CLASS_NAME); }
	SClass_ID		SuperClassID() { return UTILITY_CLASS_ID; }
	Class_ID		ClassID() { return HUJUBEXPORTER_CLASS_ID; }
	const TCHAR* 	Category() { return GetString(IDS_CATEGORY); }

	const TCHAR*	InternalName() { return _T("HujubExporter"); }	// returns fixed parsable name (scripter-visible name)
	HINSTANCE		HInstance() { return hInstance; }				// returns owning module handle

};



#endif // __HUJUBEXPORTER__H